package com.activemq.boot;

import lombok.Data;
import lombok.ToString;
import org.apache.activemq.command.ActiveMQTempTopic;
import org.apache.activemq.command.ActiveMQTopic;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

import javax.jms.Topic;

@Component
@Data
@ToString
public class ConfigBean {

    @Value("${my-topic-name}")
    private String myTopicName;

    @Bean
    public Topic topic() {
        return new ActiveMQTopic(myTopicName);
    }
}